package day01;

import lombok.extern.slf4j.Slf4j;
import utils.Sleeper;

@Slf4j
public class ThreadCase {
    public static void main(String[] args) {

        Thread t1 = new Thread("小刘") {
            @Override
            public void run() {
                log.debug("洗水壶");
                Sleeper.sleep(1);
                log.debug("烧开水");
                Sleeper.sleep(3);
            }
        };
        t1.start();


        Thread t2 = new Thread("小林") {
            @Override
            public void run() {
                log.debug("洗茶壶");
                Sleeper.sleep(1);
                log.debug("洗茶杯");
                Sleeper.sleep(2);
                log.debug("拿茶叶");
                Sleeper.sleep(1);
                try {
                    t1.join();
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
                log.debug("泡茶");
            }
        };
        t2.start();


    }
}
